﻿using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.ResponseCompression;

namespace xjjxmm.infrastructure.compont;

public class ResponseCompressionCompont : ICompont
{
    public int Order { get; set; } = 100;

    public bool Regist(WebApplicationBuilder builder) 
    {
        builder.Services.AddResponseCompression(options =>
        {
            options.EnableForHttps = true;
        });

        return false;
    }

    public bool Use(WebApplication app)
    {
        app.UseResponseCompression();

        return true;
    }
}
